import headss from '../../components/header/index.vue'
import Vue from 'vue'
import { Lazyload, Swipe, SwipeItem,Rate,RadioGroup, Radio } from 'vant'
import { Swiper, SwiperSlide } from 'vue-awesome-swiper'
import BScroll from '@better-scroll/core'
Vue.use(Lazyload)
export default {
  name:'jiyang',
  data:function(){
    return {
      value: 3,
      radio:0,
      swiperOption: {
        direction: 'vertical',
        slidesPerView: 'auto',
        freeMode: true,
        scrollbar: {
          el: '.swiper-scrollbar'
        },
        mousewheel: true,
        on: {
          touchEnd: function(swiper,event){
            //你的事件
            console.log('我到底了')
          },
        },
      },
      list:[{
        name:'赖小赖',
        desc:'伯恩山犬',
        info:'喜欢奔跑在草丛中的他们更容易感染寄生虫',
        value:false,
        img:'https://lanhu.oss-cn-beijing.aliyuncs.com/pszia3m7p3hr9q42f9pu1agho8fzgihob28cc1a8c3-3aae-420e-a880-383ba22f6cf3'
      },{
        name:'小泡芙',
        desc:'阿富汗猎犬',
        info:'喜欢奔跑在草丛中的他们更容易感染寄生虫',
        value:false,
        img:"https://lanhu.oss-cn-beijing.aliyuncs.com/psc08voio5greqjyryus04eo0jb8hjrfoa6ac7ceb-619b-4290-95ae-ccd214300782"
      },{
        name:'叮当',
        desc:'北京犬',
        info:'喜欢奔跑在草丛中的他们更容易感染寄生虫',
        value:true,
        img:'https://lanhu.oss-cn-beijing.aliyuncs.com/ps3ebydif2itdv1lyst4glk484f4sn5q3a9c3b28ac-bf98-47b4-945a-58bacefb634d'
      },{
        name:'耷拉狗狗',
        desc:'伯恩山犬',
        info:'喜欢奔跑在草丛中的他们更容易感染寄生虫',
        value:true,
        img:'https://lanhu.oss-cn-beijing.aliyuncs.com/psymfhkd3ieks24wrc24cpmbt5i0xdxdri674748a1-cb3d-4e44-babc-371ce6e1aecc'
      },{
        name:'赖小赖',
        desc:'边境牧羊犬',
        info:'喜欢奔跑在草丛中的他们更容易感染寄生虫',
        value:true,
        img:'https://lanhu.oss-cn-beijing.aliyuncs.com/psc3upzryt652k8zr6mo5zmz1w6hscywcs2a9cc2bc-11fb-4e36-a729-69a4cce419a7'
      }]
    }
  },
  components: {
    [Swipe.name]: Swipe,
    [SwipeItem.name]: SwipeItem,
    [Rate.name]: Rate,
    [RadioGroup.name]: RadioGroup,
    [Radio.name]: Radio,
    headss,
    Swiper,
    SwiperSlide,
  },
  mounted() {
    this.init()
  },
  methods: {
    init() {  
      this.bs = new BScroll(this.$refs.scroll, {
        probeType: 1,
        click: true
      })
      this.bstwo = new BScroll(this.$refs.scrolls, {
        scrollX: true,
        probeType: 3 // listening scroll event
      })
      this.bs.on('scrollStart', () => {
        console.log('scrollStart-')
      })
      this.bs.on('scroll', ({ y }) => {
        console.log('scrolling-')
      })
      this.bs.on('scrollEnd', (pos) => {
        console.log(pos)
      }) 
    },
    clickHandler (item) {
      window.alert(item)
    },
    goto(){
      this.$router.go(-1)
    },
    go(){
      this.$router.push({
        name:'BeautyDetails'
      })
    }
  }
}
